<?php defined('IN_HOPECMS') or exit('Access Denied'); ?>
<script type="text/javascript" src="{__PUBLIC__}script/tab.js"></script>
<script type="text/javascript">
$(function(){
	$('#tab .tab-title li').tab({
		content : '#tab .tab-content',
		style   : 'active'
	});
});
</script>
<form name="site" method="post">
	<div class="content-title">添加站点</div>
	<div id="tab">
		<div class="tab-title">
			<ul>
				<li class="li active">站点</li>
				<li class="li">上传</li>
				<li class="li">缩略图</li>
				<li class="li">其他</li>
			</ul>
		</div>
		<div class="clear"></div>
		<div class="tab-content">
			<table class="table-input" cellpadding="0" border="0" cellspacing="0" width="100%">
				<tr>
					<td class="td-title" width="150">站点名称：</td>
					<td class="td-value"><input type="text" v="re" msg="请输入站点名称" value="<?php if (isset($cfg['site_name'])): echo $cfg['site_name']; endif;?>" name="site_name" /><span class="col-red"> *</span></td>
					<td class="td-mark">模板变量：&#123;$cfg.site_name&#125; </td>
				</tr>
				<tr>
					<td class="td-title">站点域名：</td>
					<td class="td-value"><input type="text" v="re" msg="请输入站点域名" value="<?php if (isset($cfg['site_domain'])): echo $cfg['site_domain']; endif;?>" name="site_domain" /><span class="col-red"> *</span></td>
					<td class="td-mark">模板变量：&#123;$cfg.site_domain&#125; </td>
				</tr>
				<tr>
					<td class="td-title">网站标题：</td>
					<td class="td-value"><input type="text" value="<?php if (isset($cfg['site_title'])): echo $cfg['site_title']; endif;?>" name="site_title" /></td>
					<td class="td-mark">模板变量：&#123;$cfg.site_title&#125; </td>
				</tr>
				<tr>
					<td class="td-title">网站关键字：</td>
					<td class="td-value"><input type="text" value="<?php if (isset($cfg['site_keywords'])): echo $cfg['site_keywords']; endif;?>" name="site_keywords" /></td>
					<td class="td-mark">模板变量：&#123;$cfg.site_keywords&#125; </td>
				</tr>
				<tr>
					<td class="td-title">网站描述：</td>
					<td class="td-value"><input type="text" value="<?php if (isset($cfg['site_description'])): echo $cfg['site_description']; endif;?>" name="site_description" /></td>
					<td class="td-mark">模板变量：&#123;$cfg.site_description&#125; </td>
				</tr>
				<tr>
					<td class="td-title">网站ICP备案号：</td>
					<td class="td-value"><input type="text" value="<?php if (isset($cfg['site_icp'])): echo $cfg['site_icp']; endif;?>" name="site_icp" /></td>
					<td class="td-mark">模板变量：&#123;$cfg.site_icp&#125; </td>
				</tr>
				<tr>
					<td class="td-title">网站主题：</td>
					<td class="td-value"><input type="text" v="re" msg="请选择网站主题" value="<?php if (isset($cfg['site_theme'])): echo $cfg['site_theme']; endif;?>" name="site_theme" /><span class="col-red"> *</span></td>
					<td class="td-mark">请选择该站点要使用的主题风格</td>
				</tr>
			</table>
		</div>
		<div class="tab-content">
			<table class="table-input" cellpadding="0" border="0" cellspacing="0" width="100%">
				<tr>
					<td class="td-title" width="150">允许上传大小：</td>
					<td class="td-value"><input type="text" value="<?php if (isset($cfg['site_upload_size'])): echo $cfg['site_upload_size']; else: echo '2'; endif;?>" name="site_upload_size" /></td>
					<td class="td-mark">MB</td>
				</tr>
				<tr>
					<td class="td-title" width="150">附件保存方式：</td>
					<td class="td-value">
						<div class="long_radio_height">
							<input name="file_save_dir" type="radio" value="1" <?php echo (isset($cfg['file_save_dir']) && $cfg['file_save_dir'] == 1) ? 'checked="checked"' : ''; ?> />
							以年份的目录方式保存附件
						</div>
						<div class="long_radio_height">
							<input name="file_save_dir" type="radio" value="2" <?php echo (isset($cfg['file_save_dir']) && $cfg['file_save_dir'] == 2) ? 'checked="checked"' : !isset($cfg['file_save_dir']) ? 'checked="checked"' : '' ; ?> />
							以月份的目录方式保存附件</div>
						<div class="long_radio_height">
							<input name="file_save_dir" type="radio" value="3" <?php echo (isset($cfg['file_save_dir']) && $cfg['file_save_dir'] == 3) ? 'checked="checked"' : ''; ?> />
							以日期的目录方式保存附件
						</div>
					</td>
					<td class="td-mark">可以选择附件目录保存方式，建议选择按月份区分附件目录</td>
				</tr>
				<tr>
					<td class="td-title" width="150">允许上传类型：</td>
					<td class="td-value"><input type="text" value="<?php if (isset($cfg['site_upload_type'])): echo $cfg['site_upload_type']; else: echo 'jpg,jpeg,gif,bmp,png,rar,7z,zip,txt,ppt,doc,xls,swf'; endif;?>" name="site_upload_type" /></td>
					<td class="td-mark">站点可以上传的类型，以半角“,”分开</td>
				</tr>
			</table>
		</div>
		<div class="tab-content">
			<table class="table-input" cellpadding="0" border="0" cellspacing="0" width="100%">
				<tr>
					<td class="td-title" width="150">开启缩略图：</td>
					<td class="td-value">
					<input type="radio" name="is_thumb" value="1" <?php echo (isset($cfg['is_thumb']) && $cfg['is_thumb']==1) ? 'checked="checked"' : !isset($cfg['is_thumb']) ? 'checked="checked"' : ''; ?> />开启
					<input type="radio" name="is_thumb" value="0" <?php echo (isset($cfg['is_thumb']) && $cfg['is_thumb']==0) ? 'checked="checked"' : ''; ?> />关闭
					</td>
					<td class="td-mark">对上传过大的图片进行缩图处理，只支持JPG、PNG、GIF。但不支持动画形式的GIF</td>
				</tr>
				<tr>
					<td class="td-title" width="150">缩略图尺寸：</td>
					<td class="td-value">
						宽度 <input type="text" value="<?php if (isset($cfg['thumb_width'])): echo $cfg['thumb_width']; else: echo '300'; endif;?>" size="15" name="thumb_width" style="width: 50px;" />
						高度 <input type="text" value="<?php if (isset($cfg['thumb_height'])): echo $cfg['thumb_height']; else: echo '300'; endif;?>" size="15" name="thumb_height" style="width: 50px;" />
					</td>
					<td class="td-mark">上传的图片大于设置的宽度和高度时，将生成缩略图</td>
				</tr>
				<tr>
					<td class="td-title" width="150">开启水印：</td>
					<td class="td-value">
					<input type="radio" name="is_water" value="1" <?php echo (isset($cfg['is_water']) && $cfg['is_water']==1) ? 'checked="checked"' : ''; ?> />开启
					<input type="radio" name="is_water" value="0" <?php echo (isset($cfg['is_water']) && $cfg['is_water']==0) ? 'checked="checked"' : !isset($cfg['is_thumb']) ? 'checked="checked"' : ''; ?> />关闭
					<td class="td-mark">对上传的图片进行加水印处理</td>
				</tr>
				<tr>
					<td class="td-title" width="150">水印透明度：</td>
					<td class="td-value"><input type="text" name="water_alpha" value="<?php if (isset($cfg['water_alpha'])): echo $cfg['water_alpha']; else: echo '50'; endif;?>" /></td>
					<td class="td-mark">图片上的水印透明度</td>
				</tr>
				<tr>
					<td class="td-title" width="150">水印图片：</td>
					<td class="td-value"><input type="text" name="water_img" value="<?php if (isset($cfg['water_img'])): echo $cfg['water_img']; else: echo 'hopecms_water.png'; endif;?>" /></td>
					<td class="td-mark">请把水印图片文件放在 public/images/water 下面，格式为：png</td>
				</tr>
				<tr>
					<td class="td-title" width="150">水印位置：</td>
					<td class="td-value">
						<?php for ($i = 1; $i <= 3; $i++): ?>
						<div class="long_radio_height">
							<?php
								$n = 1;
								for ($m = 1; $m <= 3; $m++):
									if ($i == 2 && $m == 1) $n = 4;
									if ($i == 3 && $m == 1) $n = 7;
							?>
							<input type="radio" name="water_position" value="<?php echo $n;?>" <?php echo (isset($cfg['water_position']) && $cfg['water_position']==$n) ? 'checked="checked"' : (!isset($cfg['water_position']) && $n==9) ? 'checked="checked"' : ''; ?> />#<?php echo $n; ?>
							<?php $n++; endfor;?>
						</div>
						<?php endfor;?>
						</td>
					<td class="td-mark">水印在图片上的位置，3 * 3 形式，默认右下角</td>
				</tr>
			</table>
		</div>
		<div class="tab-content">
			<table class="table-input" cellpadding="0" border="0" cellspacing="0" width="100%">
				<tr>
					<td class="td-title" width="150">关闭站点：</td>
					<td class="td-value">
					<input type="radio" name="is_close" value="1" <?php echo (isset($cfg['is_close']) && $cfg['is_close']==1) ? 'checked="checked"' : ''; ?> />是
					<input type="radio" name="is_close" value="0" <?php echo (isset($cfg['is_close']) && $cfg['is_close']==0) ? 'checked="checked"' : !isset($cfg['is_thumb']) ? 'checked="checked"' : ''; ?> />否
					<td class="td-mark">是否关闭该站点</td>
				</tr>
				<tr>
					<td class="td-title" width="150">关闭原因：</td>
					<td class="td-value" ><textarea name="close_mark"><?php echo isset($cfg['close_mark']) ? $cfg['close_mark'] : '';?></textarea></td>
					<td class="td-mark">关闭站点原因说明，用于友好提示</td>
				</tr>
			</table>
		</div>
	</div>
	<input type="hidden" name="token" value="<?php echo $token_code; ?>" />
	<?php if (isset($cfg['site_id'])) : ?>
	<input type="hidden" name="site_id" value="<?php echo $cfg['site_id']; ?>" />
<?php endif; ?>
</form>